<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

Class Login_model extends CI_Model{
		
		function admin_login()
		{
		
				$this->db->where('username', $this->input->post('username'));
				$this->db->where('password', md5($this->input->post('password')));
				$query = $this->db->get('users');
				
										
				if($query->num_rows > 0)
				{	
					
					//$row = $query->row();
					foreach ($query->result() as $row)
		   				{
		     			 	 $user_id=$row->user_id;
		     			}
					
				
					return $user_id;
				
					}
							
				 else
				 {
				 	return FALSE;
				 }
				 
		}
}

?>